package JAVACORE_TRAINING.ADVANCED.SWING.DropDrag;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JTextField;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class DemoJFrame extends JFrame {

	private JPanel contentPane;
	private JTextField txtNumberA;
	private JTextField txtNumberB;
	private JTextField txtResult;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					DemoJFrame frame = new DemoJFrame();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public DemoJFrame() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JButton btnCalculate = new JButton("Calculate");
		btnCalculate.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
			//Code he
			
			}
		});
		btnCalculate.setBounds(191, 176, 89, 23);
		contentPane.add(btnCalculate);
		
		JLabel lblNumberA = new JLabel("Number A");
		lblNumberA.setBounds(26, 21, 63, 30);
		contentPane.add(lblNumberA);
		
		txtNumberA = new JTextField();
		txtNumberA.setToolTipText("Input Number A");
		txtNumberA.setBounds(154, 25, 200, 23);
		contentPane.add(txtNumberA);
		txtNumberA.setColumns(10);
		
		JLabel lblNumberB = new JLabel("Number B");
		lblNumberB.setBounds(26, 67, 63, 30);
		contentPane.add(lblNumberB);
		
		txtNumberB = new JTextField();
		txtNumberB.setBounds(154, 71, 200, 23);
		contentPane.add(txtNumberB);
		txtNumberB.setColumns(10);
		
		JLabel lblResult = new JLabel("Result");
		lblResult.setBounds(26, 114, 63, 30);
		contentPane.add(lblResult);
		
		txtResult = new JTextField();
		txtResult.setBounds(154, 114, 200, 23);
		contentPane.add(txtResult);
		txtResult.setColumns(10);
		
		JButton btnResetValue = new JButton("Reset Value");
		btnResetValue.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
			
			}
		});
		btnResetValue.setBounds(26, 176, 89, 23);
		contentPane.add(btnResetValue);
	}
}
